//
//  ZMTopicDetailViewController.m
//  基本框架
//
//  Created by runone02 on 2018/7/9.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#import "ZMTopicDetailViewController.h"
#import "ZMTopicDetailView.h"


@interface ZMTopicDetailViewController ()
/** */
@property (nonatomic, strong) ZMTopicDetailView *mainView;
@end

@implementation ZMTopicDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setMainViewUI];
    
}

- (void) setMainViewUI{
    [self setupNavView];
    self.mainView = [[ZMTopicDetailView alloc]initWithFrame:CGRectZero];
    [self.view insertSubview:self.mainView belowSubview:self.navView];
    
    [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.mas_equalTo(0);
    }];
    [self.mainView.superview layoutIfNeeded];
    self.mainView.nav = self.navView;
    self.mainView.uid = self.uid;
}

- (void) setupNavView{
    [super setupNavView];
    WEAKSELF;
    self.navView.backgroundColor = [UIColor clearColor];
    self.navView.showBottomLabel = NO;
    [self.navView.leftButton setImage:backArrowWhiteIcon forState:UIControlStateNormal];
    
    [self.navView.rightButton setImage:IMAGE(@"myCollection_share~iphone") forState:UIControlStateNormal];
    self.navView.rightButton.userInteractionEnabled = YES;
    
    self.navView.rightButtonBlock = ^{
        [weakSelf rightBtnClick];
    };
}


- (void)rightBtnClick{
    NSLog(@"右侧按钮点击");
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}
@end
